import axios from './axios-config';

export const login = async (username: string, password: string) => {
  try {
    const response = await axios.post('/login', {
      username,
      password
    });

    return response.data;
  } catch (error) {
    throw new Error('Failed to login. Please check your username and password.');
  }
};